package action;

import java.util.ArrayList;
import net.Connect;
import net.Process;
import org.w3c.dom.Document;
import start.Info;

public class PVPRedirect
{
  private static final String URL_GET_REDIRECT = Info.LoginServer + "/connect/app/battle/competition_parts?redirect_flg=1";
  private static byte[] result;

  public static boolean run()
    throws Exception
  {
    ArrayList al = new ArrayList();
    try {
      result = Process.connect.connectToServer(URL_GET_REDIRECT, al);
    } catch (Exception ex) {
      throw ex;
    }
    Document doc;
    try {
      doc = Process.ParseXMLBytes(result);
    }
    catch (Exception ex)
    {
      throw ex;
    }
    try
    {
      return parse(doc);
    } catch (Exception ex) {
      throw ex;
    }
  }

  private static boolean parse(Document doc) throws Exception
  {
    try {
      if (ExceptionCatch.catchException(doc))
        return false;
    }
    catch (Exception ex)
    {
      throw ex;
    }
    return true;
  }
}